﻿using DataModels.Enums.Bill;
using SqlSugar;
using static DataModels.Enums.GeneralEnum;

namespace DataModels.Entities.HomeService
{
    [SugarTable]
    public class HomeServicePaymentRecord
    {
        [SugarColumn(IsPrimaryKey = true)]
        public Guid UUID { get; set; }

        [SugarColumn(IsPrimaryKey = true)]
        public Guid PaymentID { get; set; }

        // 关联订单
        public Guid OrderUUID { get; set; }

        #region 支付核心信息

        /// <summary>
        /// 支付方式
        /// </summary>
        public PayWay PaymentMethod { get; set; }
        /// <summary>
        /// 支付状态
        /// </summary>
        public PaymentStatus PaymentStatus { get; set; }
        /// <summary>
        /// 实际支付金额
        /// </summary>
        public decimal PaymentAmount { get; set; }
        /// <summary>
        /// 第三方交易号
        /// </summary>
        public string TransactionNo { get; set; }
        /// <summary>
        /// 支付时间
        /// </summary>
        public DateTime PaymentTime { get; set; }

        #endregion

        #region 退款信息
        /// <summary>
        /// 是否退款
        /// </summary>
        public Status IsRefunded { get; set; } = Status.Disable;
        /// <summary>
        /// 退款金额
        /// </summary>
        public decimal RefundAmount { get; set; }
        /// <summary>
        /// 退款时间
        /// </summary>
        public DateTime? RefundTime { get; set; }
        /// <summary>
        /// 退款备注
        /// </summary>
        public string RefundRemark { get; set; }
        #endregion

        // 通用字段
        public DateTime CreateTime { get; set; } = DateTime.Now;
        public Guid CreateUserUUID { get; set; }
    }
}
